This patch fixes PV on HVM interrupt remapping with recent Linux
kernels and upstream qemu. hvm_domain_use_pirq should return positive
even if the evtchn is not currently bound. If it doesn't assert_irq
ends up injecting legacy interrupts even after the guest disabled the
irq.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
int hvm_domain_use_pirq(struct domain *d, int pirq)
{
- int emuirq;
-
if ( !is_hvm_domain(d) || pirq < 0 )
return 0;
- emuirq = domain_pirq_to_emuirq(d, pirq);
- if ( emuirq != IRQ_UNBOUND && d->pirq_to_evtchn[pirq] != 0 )
- return 1;
- else
- return 0;
+ return (domain_pirq_to_emuirq(d, pirq) != IRQ_UNBOUND);
}